#include <bits/stdc++.h>
using namespace std;
int main() {
    int a;
    int ans1 = 0;
    int ans2 = 0;
    int cnt1 = 0;
    int cnt2 = 0;
    int k;
    double average1 = 0.00;
    double average2 = 0.00;
    cin>>a>>k;
    for(int i = 1;i <= a;i ++) {
        if (i % k == 0)
            ans1 += i,cnt1 ++;
        else
            ans2 += i,cnt2 ++;
    }
    average1 = 1.00 * ans1 / cnt1;
    average2 = 1.00 * ans2 / cnt2;
    printf("%.1lf %.1lf",average1,average2);
    return 0;
}